﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Epona.Domain.Query.Impl
{
    public class ValueCompareCriterion:BasicCriterion
    {
        public object Value { get; private set; }
        public string Operator { private get; set; }

        public ValueCompareCriterion(string propName,object value)
            :base(propName)
        {
            this.Value = value;
        }

        public override string ToQueryString()
        {
            return GetPropNameWithAlias() + Operator + GetParamNameWithColon();
        }

        public override NamedParameters GetParameters()
        {
            return NamedParameters.Create().Add(GetParamName(), Value);
        }
    }
}
